package com.pt5.pthouduan.service;

import com.pt5.pthouduan.entity.Torrent;
import com.pt5.pthouduan.entity.TrackeredTorrentWithStats;
import com.pt5.pthouduan.entity.User;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

public interface TorrentService {
//    public void upload(File file);


    ////未连接口ResponseEntity<Resource> Upload(MultipartFile torrentFile, String title, String description, User user) throws Exception;
    ResponseEntity<Resource> Upload(MultipartFile torrentFile, String title, String description, Integer catrgoryId, String dpi, String caption, User user) throws Exception;
    Torrent getTorrentFile(Long torrentid);
    Resource loadTorrentFileAsResource(String filepath) throws Exception;
    void incrementDownloadCount(Long torrentid);
    List<Torrent> getAllTorrents();
    List<Torrent> getTorrentsByCategory(Integer category);
    Torrent getTorrentById(Long id);

    ResponseEntity<Resource> uploadWithCategory(MultipartFile torrentFile, String title, String description, Integer categoryId, User user, Map<String, String> extraParams) throws Exception;

    List<Torrent> getTorrentsByCategorywithfilters(Integer categoryid, Map<String, String> filters);
    //TrackeredTorrentWithStats.TorrentStats getTorrentStats(String infoHash);
}
